package com.xxx.blog.service.impl;

import com.xxx.blog.entity.Orders;
import com.xxx.blog.mapper.OrdersMapper;
import com.xxx.blog.service.OrdersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author WangXJ
 * @since 2021-09-14
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements OrdersService {


    @Autowired
    private OrdersMapper ordersMapper;


    @Override
    public int insertOneOrders(int pid, int psum, String location) {
        Orders orders = new Orders();
        orders.setPid(pid);
        orders.setPsum(psum);
        orders.setLocation(location);
        orders.setCreatedate(new Date().toString());
        return ordersMapper.insert(orders);
    }
}
